package com.eposi.eposigameinterface.adapter;

import com.eposi.eposigameinterface.R;

import android.content.Context;
import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup;
import android.widget.BaseAdapter;
import android.widget.ImageView;
import android.widget.TextView;

public class GridUserAdapter extends BaseAdapter {
	private Context context;
	LayoutInflater mInflater;
	public GridUserAdapter(Context context) {
		this.context = context;
		mInflater = (LayoutInflater) context.getSystemService(Context.LAYOUT_INFLATER_SERVICE);
	}

	@Override
	public int getCount() {
		// TODO Auto-generated method stub
		return 9;
	}

	@Override
	public Object getItem(int position) {
		// TODO Auto-generated method stub
		return null;
	}

	@Override
	public long getItemId(int position) {
		// TODO Auto-generated method stub
		return 0;
	}

	@Override
	public View getView(int position, View convertView, ViewGroup parent) {
		GridUserHolder holder;
		if (convertView ==null) {
			holder = new GridUserHolder();
			convertView = mInflater.inflate(R.layout.list_user_grid_item, null);
			holder.avatar = (ImageView) convertView.findViewById(R.id.list_user_grid_user_image);
			holder.topUser = (ImageView) convertView.findViewById(R.id.list_user_grid_user_top);
			holder.userName = (TextView) convertView.findViewById(R.id.list_user_grid_user_name);
			holder.userMoney = (TextView) convertView.findViewById(R.id.list_user_grid_user_money);
			convertView.setTag(holder);
		}else{
			holder = (GridUserHolder) convertView.getTag();
		}
		
		return convertView;
	}

	class GridUserHolder {
		ImageView avatar;
		ImageView topUser;
		TextView userName;
		TextView userMoney;

	}
}
